{% extends "base.html" %}

{% block title %}
    职员管理
{% endblock %}

{% block labal %}
    职员管理
{% endblock %}

{% block content %}
    <div class="col-lg-8">

        <a class="btn btn-default" href="./person.html">财务部</a>


        <a class="btn btn-default" href="./person.html">技术部</a>


        <a class="btn btn-default" href="./person.html">市场部</a>


        <a class="btn btn-default" href="./person.html">人事部</a>


        <a class="btn btn-default" href="./person.html">新媒体部</a>


        <a class="btn btn-default" href="./person.html">后勤部</a>


        <a class="btn btn-default" href="./person.html">安保部</a>


        <a class="btn btn-default" href="./person.html">法务部</a>


        <a class="btn btn-default" href="./person.html">董事会</a>


    </div>
    <form role="form" class="col-lg-3" method="get" action="./person.html">
                            <div class="form-group input-group">
                                <input type="hidden" name="department_id" value="">
                                <input type="text" name="person_username" class="form-control" placeholder="输入要搜索的雇员的名字"
                                       value="">
                                <span class="input-group-btn">
                    <button class="btn btn-default" type="submit">
                        <i class="fa fa-search"></i>
                    </button>
                </span>
                            </div>
                        </form>
    <div class="col-lg-1">
                            <a class="btn btn-default" href="/add_person/">添加</a>
                        </div>
    <div class="row">
                        <table class="table">
                            <thead>
                            <tr>
                                <th>职员用户名</th>
                                <th>职员年龄</th>
                                <th>职员部门</th>
                                <th>职员职位</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {% for p in p_list.items %}
                            <tr>
                                <td>{{ p.per_name }}</td>
                                <td>{{ p.age }}</td>
                                <td>{{ p.person_deparment.d_name }}</td>
                                <td>{{ p.per_pos.p_name }}</td>
                                <td>
                                    <a class="btn btn-default" href="./detail_person.html">详情</a>
                                    <a class="btn btn-default" href="./edit_person.html">编辑</a>
                                    <a class="btn btn-default" href="#">删除</a>
                                </td>
                            </tr>
                            {% endfor %}

                            </tbody>
                            <tfoot>
                            <tr>
                                <td colspan="4">
                                    <ul class="pagination">
                                        {% if p_list.has_prev %}
                                            <li><a href="/person/?page={{ p_list.prev_num }}">上一页</a></li>
                                        {% endif %}

                                        {% for p in page_range %}
                                            {% if  p_list.page == p %}
                                                <li class="active"><a href="#">{{ p }}</a></li>
                                            {% else %}
                                                <li><a href="/person/?page={{ p }}">{{ p }}</a></li>
                                            {% endif %}
                                        {% endfor %}

                                        {% if p_list.has_next %}
                                            <li><a href="/person/?page={{ p_list.next_num }}">下一页</a></li>
                                        {% endif %}
                                    </ul>
                                </td>
                            </tr>
                            </tfoot>
                        </table>
                    </div>
{% endblock %}